DROP TABLE IF EXISTS jms_ods.tab_stat_taking_timely_d ;
CREATE EXTERNAL TABLE jms_ods.tab_stat_taking_timely_d (
id                         bigint       comment "订单id" --NUMBER(20)
,waybill_id                 string       comment "运单号" --NVARCHAR2(30)
,input_time                 timestamp    comment "订单录入时间" --DATE
,pick_end_time              timestamp    comment "揽收截止时间" --DATE
,order_source_code          string       comment "订单来源编号" --NVARCHAR2(30)
,sender_province_id         bigint       comment "寄件省份id" --NUMBER(11)
,config_id                  bigint       comment "配置id" --NUMBER(20)
,create_time                timestamp    comment "创建时间" --DATE
,taking_type                smallint     comment "揽收类型 1 延误揽收 2 统计前未揽收" --NUMBER(1)
,order_source_name          string       comment "订单来源名称" --NVARCHAR2(60)
,sender_province_name       string       comment "寄件省份名称" --NVARCHAR2(60)
,sender_city_id             bigint       comment "寄件城市id" --NUMBER(11)
,sender_city_name           string       comment "寄件城市名称" --NVARCHAR2(60)
,sender_area_id             bigint       comment "寄件区域id" --NUMBER(11)
,sender_area_name           string       comment "寄件区域名称" --NVARCHAR2(60)
,pick_network_code          string       comment "取件网点编码" --NVARCHAR2(30)
,pick_network_name          string       comment "取件网点名称" --NVARCHAR2(60)
,franchisees_code           string       comment "加盟商编号" --NVARCHAR2(30)
,franchisees_name           string       comment "加盟商名称" --NVARCHAR2(60)
,proxy_area_code            string       comment "代理区编码" --NVARCHAR2(30)
,proxy_area_name            string       comment "代理区名称" --NVARCHAR2(60)
,pick_staff_code            string       comment "取件业务员编码" --NVARCHAR2(30)
,pick_staff_name            string       comment "取件业务员名称" --NVARCHAR2(60)
,pick_time                  timestamp    comment "取件时间" --DATE
,order_source_group_id      int          comment "订单来源分类id" --NUMBER(5)
,order_source_group_name    string       comment "订单来源分类名称" --NVARCHAR2(60)
,customer_code              string       comment "客户编号code" --NVARCHAR2(30)
,customer_name              string       comment "客户编号名称" --NVARCHAR2(60)
)
    COMMENT '电子包牌记录'
    PARTITIONED BY (dt STRING COMMENT '更新日期 (yyyy-MM-dd)')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_ods.db/external/tab_stat_taking_timely_d'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );

MSCK REPAIR TABLE jms_ods.tab_stat_taking_timely_d;